package com.example.ruleenginelearning.example.rules;

import com.example.ruleenginelearning.example.engine.OrderRule;
import com.example.ruleenginelearning.example.model.Order;

public class CancelledOrderRule implements OrderRule {

    @Override
    public boolean evaluate(Order order) {
        return "CANCELLED".equals(order.getStatus());
    }

    @Override
    public void execute(Order order) {
        System.out.println("取消的订单: " + order.getId() +
                " | 执行退款和库存释放");
    }
}
